package com.cedric.yixianpai.game.cards.Sects.swordCards.a_LianQi;

import com.cedric.yixianpai.game.Constants.Period;
import com.cedric.yixianpai.game.Status.DuelStatus;
import com.cedric.yixianpai.game.interfaces.SwordCard;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class ZhenLeiJian extends SwordCard {
    protected int AppendDamage;
    /**
     * 震雷剑 5/6/7+6/8/10
     */
    public ZhenLeiJian(@Value("1") int lvl) {
        super("震雷剑");
        this.setLevel(lvl);
        this.setPeriod(Period.LIANQI);
        this.setDescription("灵气-1 5/6/7攻 击伤：追加6/8/10攻");

        this.setSpiritNeed(1);
        if (1 == lvl) {
            this.setDamage(5);
            this.AppendDamage=6;
        } else if (2 == lvl) {
            this.setDamage(6);
            this.AppendDamage=8;
        } else if (3 == lvl) {
            this.setDamage(7);
            this.AppendDamage=10;
        }
    }

    @Override
    public boolean effect(DuelStatus Sta1, DuelStatus Sta2) {
        if(Sta1.spiritEnough(this.getSpiritNeed())){
            if(Sta1.attack(Sta2,this.getDamage())>0){
                Sta1.attack(Sta2,this.AppendDamage);//击伤追加
            }
            Sta1.getPlayerBuff().setSwordIntent(0);
            return true;
        }
        return false;
    }
}
